<?php
include_once "conn.php";
$census=[]; //
$user = "SELECT COUNT(*) AS census FROM user";
$goods = "SELECT COUNT(*) AS census FROM goods";
$type = "SELECT COUNT(*) AS census FROM goods_type";
$today_order = "SELECT COUNT(*) AS census FROM order_user
               JOIN order_goods ON order_user.`order_user_id` =
               order_goods.`order_user_id` WHERE 
               TO_DAYS(order_time)  = TO_DAYS(NOW())";
$total_order = "SELECT COUNT(*) AS census FROM order_goods";
$data = [$user,$goods,$type,$today_order,$total_order];
foreach ($data as $value) {
   $sql = $db -> query($value);
   $row = $sql -> fetch_assoc();
   array_push($census,$row['census']);
}
echo json_encode($census);
$db->close();
?>